home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13482 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  962 b 

  1. Path: mserv.wizvax.net!news
  2. From: tonyp@wizvax.wizvax.net (Tony Postmayer)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: malloc question
  5. Date: Sat, 06 Apr 1996 23:51:19 GMT
  6. Organization: Wizvax Communications, Troy, N.Y. 12180 USA
  7. Message-ID: <316702e2.5544507@199.181.141.3>
  8. References: <4k6tgn$13c8@pulp.ucs.ualberta.ca>
  9. NNTP-Posting-Host: tonyp.wizvax.net
  10. X-Newsreader: Forte Agent .99d/32.182
  11.  
  12. On 6 Apr 1996 23:08:07 GMT, hcolquho@gpu3.srv.ualberta.ca (Harry
  13. Colquhoun) wrote:
  14.  
  15. >Not quite sure what's happening here, most likely something real stupid I 
  16. >did, I'm sure.
  17. >
  18. >compiled using djgpp under MSDOS->works fine
  19. >compiled using djgpp on SGI->core dump 
  20. >
  21. >-------------------------
  22. >global variable 'frames'
  23. >
  24. >the problem:
  25. >
  26. >unsigned long int *mem;
  27. >mem = (unsigned long int *) malloc (frames);
  28. >-------------------------
  29. >
  30. >Anyone know why?
  31. >
  32. Don't you want to say [frames * sizeof (unsigned long int)]  ?  IOW,
  33. you're not mallocing enough memoy.
  34.  
  35.   Tony -
  36.  
  37.